GBML manual / 3D

view3d_draw_self

Draws this instance in the 3D view as thing number n, frame f (counted from 0), standing at the instance’s x and y in the room. Call it from the Draw event.

Game Boy: not available

Game Boy Color: not available

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

view3d_draw_self(thing, frame)

Arguments

NameType
thingint
frameint

Returns

Nothing.

Description

Draws this instance in the 3D view as thing number thing, frame frame (counted from 0, wrapping round at the last), standing at the instance's x and y in the room. Call it from the Draw event.

The instance's x and y are room pixels like every other position, so collision, motion and distances work exactly as they do in a top-down room; this call only puts it on the screen. It is drawn for this one frame, so call it every frame. See Enemies and items in 3D for what is hidden, how far away it is drawn and the limit of 24 things a frame.

Example

// Draw event of an enemy: thing 0, animating through frames 0 to 3
view3d_draw_self(0, (game_frame() div 8) mod 4);

The enemy is drawn standing where its x and y say, hidden behind walls in front of it.

On the GBA

The instance’s x and y are room pixels like every other position, so collision, motion and distances work as in a top-down room; this call only puts it on the screen. It is drawn for this one frame, so call it every frame. It is hidden behind nearer walls and doors, shrinks with distance and stands behind nearer things. Nothing is drawn when it is behind the camera or too small to see. At most 24 things are drawn a frame (the nearest are not favored: the first 24 asked).

See also: Enemies and items in 3Dview3d_draw_thingview3d_thing